package giang.ex.andengine;

import org.anddev.andengine.entity.sprite.AnimatedSprite;
import org.anddev.andengine.opengl.texture.region.TiledTextureRegion;

public class Plant {
	int season = 0;
	AnimatedSprite[] mSprites;

	public Plant(TiledTextureRegion[] tiledTextureRegions) {
		season = (int) (System.currentTimeMillis()/1000);
		int n = tiledTextureRegions.length;
		mSprites = new AnimatedSprite[n];
		for (int i = 0; i < n; i++) {
			mSprites[i] = new AnimatedSprite(0, 0, tiledTextureRegions[i]);
		}
	}

	public class Effect extends AnimatedSprite {

		public Effect(float pX, float pY, TiledTextureRegion pTiledTextureRegion) {
			super(pX, pY, pTiledTextureRegion);
			// TODO Auto-generated constructor stub
		}

	}

	public void setPosition(float f, float g) {
		int n = mSprites.length;
		for (int i = 0; i < n; i++) {
			mSprites[i].setPosition(f,g);
		}
		
	}

	public void animate(int time) {
		int n = mSprites.length;
		for (int i = 0; i < n; i++) {
			mSprites[i].animate(time);
		}
	}
}
